<template>
	<div>
		<component-login
			ref="login"
			:submit="submit"
		>
		</component-login>
	</div>
</template>

<script>
import '../plugin/css/login.scss';
import { mapActions } from 'vuex';
import Util from '@helper/util';
import CommonLoginComponent from '@components/common/component_login';

export default {
	name: 'LoginPage',
	components: {
		'component-login': CommonLoginComponent,
	},
	data() {
		return {
		};
	},
	computed: {
	},
	methods: {
		...mapActions({
			signIn: 'User/signIn',
		}),
		submit(request) {
			this.signIn(request)
				.then((res) => {
					Util.setCookie('token', res);
					this.$router.push('/');
				});
		},
	},
};
</script>
